]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fixes for dispose and finalize
authorOwen W. Taylor <otaylor@fishsoup.net>
Wed, 10 Mar 2010 23:22:06 +0000 (18:22 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 11 Mar 2010 20:08:48 +0000 (15:08 -0500)
* Add missing chain-up for dispose and finalize methods
* ShellGenericContainer needs to destroy its children in dispose()
* Fix variable naming and excess casts in st_label_dispose()

https://bugzilla.gnome.org/show_bug.cgi?id=612511

src/shell-app.c
src/shell-generic-container.c
src/st/st-drawing-area.c
src/st/st-entry.c
src/st/st-im-text.c
src/st/st-label.c

index 992ad8bd8e9b06dde4036bd859f63d71414587ac..7630cd0c3a0d630ac4232ccd78a707a7d1dd4701 100644 (file)
@@ -360,6 +360,8 @@ shell_app_dispose (GObject *object)
     _shell_app_remove_window (app, app->windows->data);
 
   disconnect_workspace_switch (app);
+
+  G_OBJECT_CLASS(shell_app_parent_class)->dispose (object);
 }
 
 static void
index ad34fee47a3d0bfc536fe5482b91b83cd9dfe5ef..16b285dcdc51bdb438ef43fc7bac335d0a68da24 100644 (file)
@@ -228,6 +228,17 @@ shell_generic_container_finalize (GObject *object)
   G_OBJECT_CLASS (shell_generic_container_parent_class)->finalize (object);
 }
 
+static void
+shell_generic_container_dispose (GObject *object)
+{
+  ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (object)->priv;
+
+  while (priv->children)
+    clutter_actor_destroy (priv->children->data);
+
+  G_OBJECT_CLASS (shell_generic_container_parent_class)->dispose (object);
+}
+
 static void
 shell_generic_container_class_init (ShellGenericContainerClass *klass)
 {
@@ -235,6 +246,7 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
   ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
 
   gobject_class->finalize = shell_generic_container_finalize;
+  gobject_class->dispose = shell_generic_container_dispose;
 
   actor_class->get_preferred_width = shell_generic_container_get_preferred_width;
   actor_class->get_preferred_height = shell_generic_container_get_preferred_height;
index 720c4003da512b719557317cb5f3724315b3cb87..7115655cded3d58c1eb246345023222cc5e6d6b5 100644 (file)
@@ -63,6 +63,8 @@ st_drawing_area_dispose (GObject *object)
       cogl_handle_unref (priv->texture);
       priv->texture = COGL_INVALID_HANDLE;
     }
+
+  G_OBJECT_CLASS (st_drawing_area_parent_class)->dispose (object);
 }
 
 static void
index fa104893238b8a4dbdc59461feb0eaf1ffea1e59..147640d7edf863fac0288a6c6d8214b41e272dd8 100644 (file)
@@ -171,6 +171,8 @@ st_entry_dispose (GObject *object)
       clutter_actor_destroy (priv->entry);
       priv->entry = NULL;
     }
+
+  G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
 }
 
 static void
@@ -180,6 +182,8 @@ st_entry_finalize (GObject *object)
 
   g_free (priv->hint);
   priv->hint = NULL;
+
+  G_OBJECT_CLASS (st_entry_parent_class)->finalize (object);
 }
 
 static void
index aa94b40586c006d43dd719dd0f2966c8c0e762c0..29fd71e4dc7646a4bc06c43825306b2dc4f3935a 100644 (file)
@@ -93,6 +93,8 @@ st_im_text_dispose (GObject *object)
 
   g_object_unref (priv->im_context);
   priv->im_context = NULL;
+
+  G_OBJECT_CLASS (st_im_text_parent_class)->dispose (object);
 }
 
 static void
index 1a304a4bf482428607986f2e9d3ff752994579f2..0b6a9fd23794f9d537f291a62e44e4d9123f96e2 100644 (file)
@@ -172,9 +172,9 @@ st_label_allocate (ClutterActor          *actor,
 }
 
 static void
-st_label_dispose (GObject   *actor)
+st_label_dispose (GObject   *object)
 {
-  StLabelPrivate *priv = ST_LABEL (actor)->priv;
+  StLabelPrivate *priv = ST_LABEL (object)->priv;
 
   if (priv->label)
     {
@@ -182,7 +182,7 @@ st_label_dispose (GObject   *actor)
       priv->label = NULL;
     }
 
-  G_OBJECT_CLASS (st_label_parent_class)->dispose (G_OBJECT (actor));
+  G_OBJECT_CLASS (st_label_parent_class)->dispose (object);
 }
 
 static void